package com.pioneer.web.purchase.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pioneer.web.purchase.domain.PurOrder;
import com.pioneer.web.purchase.domain.PurPlan;
import org.springframework.transaction.annotation.Transactional;

/**
 * IPurOrderService
 *
 * @author hlm
 * @date 2025-04-02 14:22:16
 */
public interface IPurOrderService extends IService<PurOrder> {

    /**
     * 根据采购计划单生成采购订单
     * @param plan 采购计划单
     * @return 结果
     */
    @Transactional(rollbackFor = Exception.class)
    String genOrderByPlan(PurPlan plan);

    /**
     * 根据采购计划单删除采购订单
     * @param plan 采购计划单
     * @return 结果
     */
    @Transactional(rollbackFor = Exception.class)
    String delOrderByPlan(PurPlan plan);

    /**
     * 根据采购订单id获取详细信息
     * @param orderId 采购订单id
     * @return 结果
     */
    PurOrder selectOrderById(Long orderId);

    /**
     * 修改采购订单
     * @param order 采购订单
     * @return 结果
     */
    @Transactional(rollbackFor = Exception.class)
    boolean updateOrder(PurOrder order);

    /**
     * 提交采购订单
     * @param order 采购订单
     * @return 结果
     */
    boolean commitOrder(PurOrder order);

    /**
     * 审批采购订单
     * @param order 采购订单
     * @return 结果
     */
    boolean approveOrder(PurOrder order);
}
